﻿using HelpDeskTool.Entities.Devices;
using NUnit.Framework;

namespace HelpDeskToolTests;

[TestFixture]
public class RamModuleTests
{
	[TestCase(null, 0, 0, ExpectedResult = "")]
	[TestCase("", 0, 0, ExpectedResult = "")]
	[TestCase("   ", 0, 0, ExpectedResult = "")]
	[TestCase("\t\n", 0, 0, ExpectedResult = "")]
	[TestCase("Model", 8192, 3200, ExpectedResult = "8 GB | 3200 MHz | Model")]
	[TestCase("Model", 512, 3200, ExpectedResult = "512 MB | 3200 MHz | Model")]
	[TestCase(null, 8000, 3200, ExpectedResult = "8 GB | 3200 MHz")]
	[TestCase("", 8192, 3200, ExpectedResult = "8 GB | 3200 MHz")]
	[TestCase(" ", 8192, 3200, ExpectedResult = "8 GB | 3200 MHz")]
	[TestCase(" ", 0, 3200, ExpectedResult = "3200 MHz")]
	[TestCase(" ", 4000, 0, ExpectedResult = "4 GB")]
	[TestCase("Model", 4000, 0, ExpectedResult = "4 GB | Model")]
	[TestCase("Model", 0, 1866, ExpectedResult = "1866 MHz | Model")]
	[TestCase("Model", 0, 0, ExpectedResult = "Model")]
	public string ToStringShouldBeFullOrPartial(string? modelName, int capacity, int speed)
	{
		var device = new RamModule
		{
			ModelName = modelName,
			Capacity = (uint)capacity,
			Speed = (uint)speed
		};

		return device.ToString();
	}
}
